package pt.utl.ist.project_ccu;

import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SocialNetwork extends Activity {

	HashMap<String,Button> buttons;
	Button backbuttonadd, buttonfacebook, buttonflickr, buttontumblr, buttongoogleplus;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_social_network);

		setupButtons();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_social_network, menu);
		return true;
	}

	public void setupButtons() {
		buttons = new HashMap<String,Button>();


		buttons.put("upload", backbuttonadd);

		buttonfacebook = (Button) findViewById(R.id.buttonfacebook);

		buttons.put("uploadFacebook", buttonfacebook);

		buttonfacebook.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				Intent viewIntent =
				          new Intent("android.intent.action.VIEW",
				            Uri.parse("https://www.facebook.com/hugo.goncalves.9026?fref=ts"));
				          startActivity(viewIntent);
			}
		});
		
		buttonflickr = (Button) findViewById(R.id.buttonflickr);

		buttons.put("uploadFlickr", buttonflickr);

		buttonflickr.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				Intent viewIntent =
				          new Intent("android.intent.action.VIEW",
				            Uri.parse("http://www.flickr.com/"));
				          startActivity(viewIntent);
			}
		});
		
		buttontumblr = (Button) findViewById(R.id.buttontumblr);

		buttons.put("uploadTumblr", buttontumblr);

		buttontumblr.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				Intent viewIntent =
				          new Intent("android.intent.action.VIEW",
				            Uri.parse("http://www.tumblr.com/"));
				          startActivity(viewIntent);
			}
		});
		
		buttongoogleplus = (Button) findViewById(R.id.buttongoogleplus);

		buttons.put("uploadGooglePlus", buttongoogleplus);

		buttongoogleplus.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				Intent viewIntent =
				          new Intent("android.intent.action.VIEW",
				            Uri.parse("https://plus.google.com/"));
				          startActivity(viewIntent);
			}
		});
	}

}
